﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using GNF.Geo;
using GNF.GNFService.GNFClient;

namespace GNF.TestControls
{
    /// <summary>
    /// Interaction logic for KunefaTest.xaml
    /// </summary>
    public partial class KunefaTest : Window
    {
        private GNFServiceClient client = new GNFServiceClient();

        public KunefaTest()
        {
            InitializeComponent();

            m_data = new GPSData();
			BasicView.DataContext = m_data;
            //m_beni.DataContext = m_data;
            //client = new GNFServiceClient();
            client.Connect();
            client.GPSDataChanged += new TimedOnGPSDataChangedEventHandler(ChangeData);
        }

        private void ChangeData(GPSData data, DateTime changeTime)
        {
            m_data.ChangeTo(data);
        }

        private GPSData m_data;

        private void m_yosi_Click(object sender, RoutedEventArgs e)
        {
            Random rnd = new Random();
            m_data.Latitude = 5454 * rnd.NextDouble();
        }
    }
}
